package homework;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class work3 {
    public static void main(String[] args) {
        Map m=new HashMap();
        m.put("jack",650);
        m.put("tom",1200);
        m.put("smith",3000 );
        
        m.put("jack", 2600);
        System.out.println(m);
        Set ks=m.keySet();
        for(Object key:ks){
            m.put(key, (Integer)m.get(key)+100);
        }
        //遍历
        Set et=m.entrySet();
        Iterator it =et.iterator();
        while(it.hasNext()){
            Map.Entry entry=(Map.Entry)it.next();
            System.out.println(entry.getKey()+"-"+entry.getValue());
        }
    }
}
